﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LowLevelGraphics.Filter.Matlabrelated
{
    /// <summary>
    ///B = blockproc(A,[M N],fun) processes the image A by applying the function fun to each distinct M-by-N block of A 
    ///and concatenating the results into B, the output matrix. 
    ///fun is a function handle to a function that accepts a block struct as input and returns a matrix, 
    ///vector, or scalar Y. For example, Y = fun(block_struct). 
    ///(For more information about a block struct, see the Definition section below.) 
    ///For each block of data in the input image, A, blockproc passes the block in a block struct to the user function, 
    ///fun, to produce Y, the corresponding block in the output image. If Y is empty, 
    ///blockproc does not generate any output and returns empty after processing all blocks. 
    ///Choosing an appropriate block size can significantly improve performance. 
    ///For more information, see Choosing Block Size in the Image Processing Toolbox™ documentation.
    ///
    /// B = blockproc(src_filename,[M N],fun) processes the image src_filename, 
    /// reading and processing one block at a time. This syntax is useful for processing very large images since only one block of 
    /// the image is read into memory at a time. If the output matrix B is too large to fit into memory,
    /// omit the output argument and instead use the 'Destination' parameter/value pair to write the output to a file.
    /// 
    /// B = blockproc(adapter,[M N],fun) processes the source image specified by adapter, an ImageAdapter object. An ImageAdapter is a user-defined class that provides blockproc with a common API for reading and writing to a particular image file format. For more information, see Writing an Image Adapter Class in the Image Processing Toolbox documentation.
    /// 
    /// blockproc(...,param,val,...) processes the input image, specifying parameters and corresponding values that control
    /// various aspects of the block behavior. Parameter names are not case sensitive. 
    /// </summary>
    public class blockproc : BaseImageFilter
    {
        /// <summary>
        /// default constructor
        /// </summary>
        public blockproc()
        {
        }

        /// <summary>
        /// constructor to create a deep copy
        /// </summary>
        /// <param name="_blockproc"></param>
        internal blockproc(blockproc _blockproc)
        { 
        }

        /// <summary>
        /// Execute this filter
        /// </summary>
        /// <param name="_bitmap"></param>
        /// <returns></returns>
        public override UnsafeBitmap Execute(UnsafeBitmap _bitmap)
        {
            return base.Execute(_bitmap);
        }

        /// <summary>
        /// clone this instance
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            return new blockproc(this);
        }
    }
}
